//
//  SecondViewController.m
//  UI-02 Homework 完成登录-注册-忘记密码
//
//  Created by 冀永金 on 16/7/15.
//  Copyright © 2016年 冀永金. All rights reserved.
//

#import "SecondViewController.h"
#import "CustomView.h"
@interface SecondViewController ()

@end

@implementation SecondViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self config];
    // Do any additional setup after loading the view.
}
- (void)config {
    UIImageView *backGroundImage = [[UIImageView alloc]initWithFrame:self.view.frame];
    backGroundImage.image = [UIImage imageNamed:@"welcome_2"];
    [self.view addSubview:backGroundImage];
    backGroundImage.alpha = .7;
    UIImageView *imageOfLogo = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 100, 140)];
    [self.view addSubview:imageOfLogo];
    imageOfLogo.image = [UIImage imageNamed:@"logo_lagou"];
    imageOfLogo.center = CGPointMake(self.view.frame.size.width / 2, 200);
    CustomView *viewOfUser = [[CustomView alloc]initWithFrame:CGRectMake(20, 300, self.view.frame.size.width - 40,55) leftImage:[UIImage imageNamed:@"Unknown.png"] placeHolder:@"请输入手机号"];
    [self.view addSubview:viewOfUser];
    CustomView *viewOfPassword = [[CustomView alloc]initWithFrame:CGRectMake(20, 360, self.view.frame.size.width - 110,55) leftImage:[UIImage imageNamed:@"icon_password"] placeHolder:@"请输入验证码"];
    [self.view addSubview:viewOfPassword];
    UIButton *buttonOfCreate = [UIButton buttonWithType:UIButtonTypeSystem];
    [self.view addSubview: buttonOfCreate];
    [buttonOfCreate setTitle:@"获取验证码" forState:UIControlStateNormal];
    buttonOfCreate.frame = CGRectMake(self.view.frame.size.width - 110, 360, 90, 55);
    buttonOfCreate.tintColor = [UIColor colorWithRed:0.14 green:0.65 blue:0.52 alpha:1.00];
    buttonOfCreate.titleLabel.font = [UIFont systemFontOfSize:18];
    buttonOfCreate.backgroundColor = [UIColor colorWithRed:0.29 green:0.29 blue:0.28 alpha:1.00];
    
    UILabel *leftLabel = [[UILabel alloc]initWithFrame:CGRectMake(80, 405, 200, 80)];
    [self.view addSubview:leftLabel];
    leftLabel.text =@"注册代表你已同意";
    leftLabel.textColor = [UIColor whiteColor];
    leftLabel.font = [UIFont systemFontOfSize:20];
    UILabel *rightLabel = [[UILabel alloc]initWithFrame:CGRectMake(240, 405, 150, 80)];
    [self.view addSubview:rightLabel];
    rightLabel.text = @"拉勾用户协议";
    rightLabel.textColor = [UIColor colorWithRed:0.15 green:0.58 blue:0.46 alpha:1.00];
    rightLabel.font = [UIFont systemFontOfSize:20];
    UIButton *buttonOfLogin = [UIButton buttonWithType:UIButtonTypeSystem];
    [self.view addSubview:buttonOfLogin];
    buttonOfLogin.frame = CGRectMake(20, 485, self.view.frame.size.width - 40, 55);
    [buttonOfLogin setTitle:@"注册" forState:UIControlStateNormal];
    [buttonOfLogin setTitleColor:[UIColor colorWithRed:0.26 green:0.78 blue:0.66 alpha:1.00] forState:UIControlStateNormal];
    buttonOfLogin.backgroundColor = [UIColor colorWithRed:0.10 green:0.70 blue:0.54 alpha:1.00];
    buttonOfLogin.titleLabel.font = [UIFont systemFontOfSize:22];
    UIButton *buttonOfZhuce = [UIButton buttonWithType:UIButtonTypeSystem];
    [self.view addSubview:buttonOfZhuce];
    buttonOfZhuce.frame = CGRectMake(20, 550, self.view.frame.size.width - 40, 55);
    [buttonOfZhuce setTitle:@"返回登录" forState:UIControlStateNormal];
    [buttonOfZhuce setTitleColor:[UIColor colorWithRed:0.17 green:0.65 blue:0.51 alpha:1.00] forState:UIControlStateNormal];
    buttonOfZhuce.backgroundColor = [UIColor colorWithRed:0.23 green:0.27 blue:0.22 alpha:1.00];
    buttonOfZhuce.alpha = .7;
   // buttonOfZhuce.layer.borderColor = [UIColor greenColor].CGColor;
    buttonOfZhuce.titleLabel.font = [UIFont systemFontOfSize:22];
    [buttonOfZhuce.layer setMasksToBounds:YES];//设置按钮的圆角半径不会被遮挡
    
    [buttonOfZhuce.layer setCornerRadius:10];
    
    [buttonOfZhuce.layer setBorderWidth:2];//设置边界的宽度
    //设置按钮的边界颜色
    buttonOfZhuce.layer.borderColor = [UIColor colorWithRed:0.24 green:0.61 blue:0.48 alpha:1.00].CGColor;

    [buttonOfZhuce addTarget:self action:@selector(handleBack:) forControlEvents:UIControlEventTouchUpInside];
    
    
}

- (void)handleBack:(UIButton *)button {
    [self.navigationController popToRootViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
